<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.hll.model.Pagination"%>

<%
    String status = (String) request.getAttribute("status");
    Pagination pagination = (Pagination) request.getAttribute("pagination");
%>

<div class="pagination">
  <span class="first-page">
  <%
    if (pagination.isFirstPage()) {
  %>
    <img src="<%=request.getContextPath()%>/static/images/MyBooks_BTN_FirstPage_Disable_20x20.png" /> 
  <%
    } else {
  %> 
    <a href="<%=request.getContextPath()%>/mybook.action?currentPage=1&status=<%=status%>"> 
      <img src="<%=request.getContextPath()%>/static/images/MyBooks_BTN_FirstPage_Normal_20x20.png" />
    </a>
  <%
    }
  %>
  </span> 
  
  <span class="pre-page"> 
  <%
    if (!pagination.isFirstPage() && pagination.getPageCount() > 1) {
  %> 
    <a href="<%=request.getContextPath()%>/mybook.action?currentPage=<%=pagination.getCurrentPage() - 1%>&status=<%=status%>"> 
      <img src="<%=request.getContextPath()%>/static/images/MyBooks_BTN_PrePage_Normal_20x20.png" />
    </a> 
  <%
    } else {
  %> 
    <img src="<%=request.getContextPath()%>/static/images/MyBooks_BTN_PrePage_Disable_20x20.png" />
  <%
    }
  %>
  </span>

  <span class="current-page"> 
      第<%=pagination.getCurrentPage()%>页
  </span>
  <span class="next-page"> 
  <%
     if (!pagination.isLastPage() && pagination.getPageCount() > 1) {
  %>
    <a href="<%=request.getContextPath()%>/mybook.action?currentPage=<%=pagination.getCurrentPage() + 1%>&status=<%=status%>">
      <img src="<%=request.getContextPath()%>/static/images/MyBooks_BTN_NextPage_Normal_20x20.png" />
    </a>
  <%
    } else {
  %> 
    <img src="<%=request.getContextPath()%>/static/images/MyBooks_BTN_NextPage_Disable_20x20.png" /> 
  <%
    }
  %>
  </span>

  <span class="last-page"> 
  <%
    if (pagination.isLastPage()) {
  %> 
  <img src="<%=request.getContextPath()%>/static/images/MyBooks_BTN_LastPage_Disable_20x20.png" />
  <%
    } else {
  %>
    <a href="<%=request.getContextPath()%>/mybook.action?currentPage=<%=pagination.getPageCount()%>&status=<%=status%>">
      <img src="<%=request.getContextPath()%>/static/images/MyBooks_BTN_LastPage_Normal_20x20.png"/>
    </a>
  <%
    }
  %>
  </span>

  <span class="total-page"> 共<%=pagination.getPageCount()%>页</span>
  <span class="go-desc">到第</span>
  <input type="text" class="go-input" id="currentPage" name="currentPage" value="<%=pagination.getCurrentPage()%>" />
  <span class="go-page"> 页</span>
  <div class="go-button" onclick="paginationGo('<%=status%>')">GO</div>
</div>
<script type="text/javascript" src="<%=request.getContextPath()%>/static/js/pagination.js"></script>